package com.neuedu.part08;

public class Account {
	private String account;
	private double balance;
	
	
	
	public Account(String account, double balance) {
		this.account = account;
		this.balance = balance;
	}

	public void Save(double d) {
		this.balance=this.balance+d;
		System.out.println(this.balance);
	}
	
	public void Pay(double d) throws BNEException{
		this.balance=this.balance-d;
		System.out.println(this.balance);
		if (this.balance<0) {
			throw new BNEException();
		}
	}

}
